package com.service.pay.diamond.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
public class UnifiedOrderDto {
    @Size(min = 20, max = 32, message = "订单号长度在{min}-{max}位之间")
    private String orderNo;
    @NotBlank(message = "商品描述不能为空")
    @Size(max = 64, message = "商品描述长度不能超过{max}个字符")
    private String body;
    @NotBlank(message = "附加数据不能为空")
    @Size(max = 256, message = "商品描述长度不能超过{max}个字符")
    private String attach;
    @Positive(message = "价格必须大于0")
    private int fee;
    @NotBlank(message = "ip不能为空")
    private String ip;
    private String redirectUrl;
    @NotBlank(message = "通知回调url不能为空")
    @Size(max = 256, message = "通知回调url长度不能超过{max}位")
    private String notifyUrl;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date timeStart;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date timeEnd;
}
